package Client.logic;

import java.io.Serializable;
import java.sql.SQLException;

import javax.sql.rowset.serial.SerialBlob;
import javax.sql.rowset.serial.SerialException;
/**
 * 
 * @author Baglama
 *
 */
public class MyFile implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String fileName=null;	
	private SerialBlob blob;
	private int size;
	/**
	 * 
	 * @param fileName
	 * @param mybytearray
	 */
	public MyFile(String fileName, byte [] mybytearray) {
		this.fileName = fileName;
		try {
			this.blob = new SerialBlob(mybytearray);
			this.size = mybytearray.length;
		} catch (SerialException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	/**
	 * 
	 * @param fileName
	 * @param blob
	 * @param size
	 */
	public MyFile(String fileName, SerialBlob blob, int size) {
		this.fileName = fileName;
		this.blob = blob;
		this.size = size;
	}
	/**
	 * 
	 * @return fileName
	 */
	public String getFileName() {
		return fileName;
	}
/**
 * 
 * @return
 */
	public SerialBlob getBlob() {
		return blob;
	}
	/**
	 * 
	 * @return size
	 */
	public int getSize() {
		return size;
	}
	
	
}

